home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 8: LINUX Games / Linux Cubed Series 8 - LINUX Games.iso / games / x11 / networke / xfirepow.000 / xfirepow / xfirepower-0.84 / client / libsprite / tile.c < prev    next >
C/C++ Source or Header  |  1995-05-23  |  994b  |  46 lines

  1. #include "allincludes.h"
  2.  
  3. void
  4. W_TileWindow(window, image)
  5.     W_Window window;
  6.     W_Image  *image;
  7. {
  8.     Window  win;
  9.  
  10.     check_loaded(image);
  11. #ifdef DEBUG
  12.     printf("Tiling window %d\n", window);
  13. #endif
  14.     win = W_Void2Window(window)->window;
  15.  
  16.     if (image->xpm == 0) {
  17.     Pixmap orig;
  18.     orig = image->pixmap;
  19.     image->pixmap = XCreatePixmap(W_Display, W_Root,
  20.           image->width, image->height, 
  21.           (unsigned)DefaultDepth(W_Display, W_Screen));
  22.     XCopyPlane(W_Display, orig, image->pixmap,
  23.        colortable[W_White].contexts[0], 0, 0, image->width, image->height,
  24.            0, 0, 1);
  25.     image->xpm = 1;
  26.     }
  27.     XSetWindowBackgroundPixmap(W_Display, win, image->pixmap);
  28.     XClearWindow(W_Display, win);
  29. }
  30.  
  31. void
  32. W_UnTileWindow(window)
  33.     W_Window window;
  34. {
  35.     Window  win;
  36.  
  37. #ifdef DEBUG
  38.     printf("Untiling window %d\n", window);
  39. #endif
  40.     win = W_Void2Window(window)->window;
  41.  
  42.     XSetWindowBackground(W_Display, win, colortable[W_Black].pixelValue);
  43.     XClearWindow(W_Display, win);
  44. }
  45.  
  46.